<?php if (!defined("_ECRIRE_INC_VERSION")) return;
require_once(_DIR_PLUGIN_ECATALOGUE.'classes/class.RubriqueCurrencyModel.php');

function formulaires_ecatalogue_rubrique_currency_traiter_dist($id_rubrique) {
    $result = array();
    
    $model = new RubriqueCurrencyModel();
    
    $data = $model->form_data_from_array($_REQUEST);
    
    $flag_result = true;
    if (!$data['id_currency'])
        $flag_result = $model->delete_by_id($id_rubrique);
    else     
        /*$flag_result = */$model->update_by_id($id_rubrique, $data, true);                
    
    if ($flag_result) {
        $result['message_ok'] = _T('ecatalogue:form_saved');
    } else {
        $result['message_erreur'] = _T('ecatalogue:form_error');
    }
    
    return $result;    
}

?>